﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Skala.master" AutoEventWireup="true" CodeFile="AnaSayfa.aspx.cs" Inherits="AnaSayfa" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript">
        function Begen(id, UrunId, hidId) {

            var hidField = '#' + hidId;
            $(hidField).val(UrunId);

            var btnHelper = '#' + id;
            $(btnHelper).trigger("click");
        }
        function CantayaEkle(UrunId, cantaDurumu) {
            var hidUrun = '#' + '<%= hidUrunId.ClientID  %>';
            var hidCanta = '#' + '<%= hidCantaDurumu.ClientID  %>';
            var btnCanta = '#' + '<%= btnCantayaEkle.ClientID  %>';
            $(hidUrun).val(UrunId);
            $(hidCanta).val(cantaDurumu);
            $(btnCanta).trigger("click");
        }

        $(function () {
            $('#slides').slides({
                preload: true,
                preloadImage: 'img/loading.gif',
                play: 5000,
                pause: 2500,
                hoverPause: true,
                animationStart: function (current) {
                    $('.caption').animate({
                        bottom: -35
                    }, 100);

                },
                animationComplete: function (current) {
                    $('.caption').animate({
                        bottom: 0
                    }, 200);

                },
                slidesLoaded: function () {
                    $('.caption').animate({
                        bottom: 0
                    }, 200);
                }
            });
        });

        $(document).ready(function () {
            var def = Sys.WebForms.PageRequestManager.getInstance();


            def.add_endRequest(function () {
                $('#slides').slides({
                    preload: true,
                    preloadImage: 'img/loading.gif',
                    play: 5000,
                    pause: 2500,
                    hoverPause: true,
                    animationStart: function (current) {
                        $('.caption').animate({
                            bottom: -35
                        }, 100);

                    },
                    animationComplete: function (current) {
                        $('.caption').animate({
                            bottom: 0
                        }, 200);

                    },
                    slidesLoaded: function () {
                        $('.caption').animate({
                            bottom: 0
                        }, 200);
                    }
                });
            });
        });

    </script>
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="duzen"></div>
  <div id="vitrin-kapsam">
    <div id="slides">
      <div class="slides_container">
          <asp:ListView ID="listVitrinResim" runat="server" DataSourceID="dsVitrinResim">
            <ItemTemplate>
                <div class="slide"> <a href="http://skaladeri.com.tr" target="_parent" style="width:21px; height:21px; border:none;"><img src="img/<%#Eval( "ResimAdi")%>"  title="skaladeri.com.tr" width="1022" alt="Slide 2"/></a> </div>
            </ItemTemplate>
            </asp:ListView>
            <asp:SqlDataSource runat="server" ID="dsVitrinResim" ConnectionString='<%$ ConnectionStrings:Skala %>' 
        SelectCommand="SELECT  [ResimAdi] FROM [VitrinResim] where GorunsunMu = 1 order by Isnull([SiraNo],100)"></asp:SqlDataSource>
      </div>
      <a href="#" class="prev"></a> <a href="#" class="next"></a> </div>
    <div class="golge"></div>
  </div>
  <div class="duzen"></div>
  <div id="govde-kapsam">
    <div id="govde-sol-kapsam">
      <div class="sol-menu-kategori">
        <h2 class="baslik-h2"><asp:Label ID="lblBayanCanta" runat="server" /></h2>
        <nav>
          <ul class="kategori-link">
            <asp:ListView ID="listBayanKategori" runat="server" DataSourceID="BayanKategori" >
                <ItemTemplate>
                    <li class="Kategori" id='<%# Eval( "KategoriId") %>' ><a href='<%# Page.GetRouteUrl("Kategori", new  {AnaKategoriId=-1,KategoriId=Eval( "KategoriId"),KategoriAdi=Temizle.UrlCevir(Eval( "KategoriAdi").ToString()) })%>'><%#Eval( "KategoriAdi")%></a></li>
              </ItemTemplate>
            </asp:ListView>
            <asp:SqlDataSource ID="BayanKategori" runat="server" ConnectionString="<%$ ConnectionStrings:Skala %>" SelectCommand="GetKategoriBayan" SelectCommandType="StoredProcedure">
                  <SelectParameters>
                      <asp:CookieParameter CookieName="dil" DefaultValue="TR" Name="Dil" Type="String"></asp:CookieParameter>
                  </SelectParameters>
            </asp:SqlDataSource>
          </ul>
        </nav>
      </div>
      <div class="duzen"></div>
      <div class="sol-menu-kategori">
        <h2 class="baslik-h2"><asp:Label ID="lblErkekCanta" runat="server" /></h2>
        <nav>
          <ul class="kategori-link">
            <asp:ListView ID="listErkekKategori" runat="server" DataSourceID="ErkekKategori" >
                <ItemTemplate>
                    <li class="Kategori" id='<%# Eval( "KategoriId") %>'><a href='<%# Page.GetRouteUrl("Kategori", new  {AnaKategoriId=-1,KategoriId=Eval( "KategoriId"),KategoriAdi=Temizle.UrlCevir(Eval( "KategoriAdi").ToString()) })%>'><%#Eval( "KategoriAdi")%></a></li>
              </ItemTemplate>
            </asp:ListView>
              <asp:SqlDataSource ID="ErkekKategori" runat="server" ConnectionString="<%$ ConnectionStrings:Skala %>" SelectCommand="GetKategoriErkek" SelectCommandType="StoredProcedure">
                  <SelectParameters>
                      <asp:CookieParameter CookieName="dil" DefaultValue="TR" Name="Dil" Type="String"></asp:CookieParameter>
                  </SelectParameters>
            </asp:SqlDataSource>
          </ul>
        </nav>
      </div>
    </div>
    <!--GÖVDE ORTA KAPSAM-->
    <div id="govde-orta-kapsam">
      <div class="kategori-urun-baslik">
        <h2><asp:Label ID="lblSectiklerimiz" runat="server" /></h2>
        <div> 
    
    <asp:HiddenField   ID="hidCantaDurumu" runat="server" Value="0" />
    <asp:HiddenField   ID="hidUrunId" runat="server" Value="0" />
    <asp:Button Style="display:none;"  ID="btnCantayaEkle" runat="server" UseSubmitBehavior="false"  OnClick="btnCantayaEkle_Click" Text="Button" />
    <asp:Button Style="display:none;"  ID="btnHelper" runat="server" UseSubmitBehavior="false"  OnClick="btnHelper_Click" Text="Button" />
    <asp:ListView ID="listCanta" runat="server"  DataSourceID="Urunler"  >
        <ItemTemplate >
          <!--ÜRÜN ANA KAPSAM--> 
          <!-- 1 ÜRÜN KAPSAM -->
          <div class="urun-dis-kapsam">
            <div class="urun-kapsam">
              <div>
                <div class="tovar_item">
                  <div class="tovar_img">
                    <div class="tovar_img_wrapper"> <img class="img" src='urunler/<%# Eval( "OrtancaResimAdi") %>' alt="Ürün bilgi" title="Ürün başlık" /> 
                        <img class="img_h" src="/images/urun-golge.jpg" alt="" /> </div>
                    <div class="urun-adi"><%#Eval( "UrunKodu")%></div>
                    <div class="urun-kampanya-turu-bilgisi"><%#Eval( "KampanyaAdi")%></div>
                    <div class="tovar_item_btns"> 
                        <a class="<%#Eval( "KalpSimgesi")%>" href="#" onclick="Begen('<%= btnHelper.ClientID  %>','<%#Eval( "UrunId")%>','<%= hidUrunId.ClientID  %>');">
                         <i class="fa fa-heart kalp-3"   ></i>                         
                      </a> 
                        <a class="add_bag"  href='<%# Page.GetRouteUrl("Urun",new {UrunId = Eval( "UrunId"),UrunAdi=Temizle.UrlCevir(Eval( "UrunAdi").ToString()) }) %>' ><i class="fa fa-search buyutec-3"></i></a></div>
                  </div>
                  <div class="urun-fiyati"><%#Eval( "Fiyat")%> </div>
                  <div class="urun-fiyat-eski"></div>
                  <div class="urun-satin-alma-dugmeleri clearfix">
                    <ul>
                      <li><a href='<%# Page.GetRouteUrl("TeslimatAdresi",new {UrunId = Eval( "UrunId")}) %>'><%#Eval( "HizliAl")%></a></li>
                      <li><a href="#" onclick="CantayaEkle('<%#Eval( "UrunId")%>','<%#Eval( "CantaDurumu")%>');"><%#Eval( "CantaAciklama")%><%#Eval( "CantaSimgesi")%></a></li>
                    </ul>
                  </div>
                </div>
              </div>
              <div class='<%#Eval( "KampanyaMi")%>'></div>
              <div class='<%#Eval( "YeniMi")%>'></div>
            </div>
          </div>
          <!-- //1 ÜRÜN KAPSAM -->  
            </ItemTemplate>
            </asp:ListView>
<asp:SqlDataSource ID="Urunler" runat="server" ConnectionString="<%$ ConnectionStrings:Skala %>" SelectCommand="GetUrunler" SelectCommandType="StoredProcedure">
<SelectParameters>
    <asp:QueryStringParameter DefaultValue="-1" Name="UrunId" QueryStringField="UrunId" Type="Int32" />
    <asp:Parameter Name="AnakategoriId" Type="Int32" DefaultValue="-1"></asp:Parameter>
    <asp:QueryStringParameter DefaultValue="-1" Name="KategoriId" QueryStringField="KategoriId" Type="Int32" />
    <asp:Parameter Name="cantaTuruId" Type="Int32" DefaultValue="-1"></asp:Parameter>
    <asp:Parameter Name="deriCesidiId" Type="Int32" DefaultValue="-1"></asp:Parameter>
    <asp:Parameter Name="RenkId" Type="Int32" DefaultValue="-1"></asp:Parameter>
    <asp:Parameter Name="DesenId" Type="Int32" DefaultValue="-1"></asp:Parameter>
    <asp:Parameter Name="UrunAdi" Type="String" DefaultValue=" "></asp:Parameter>
    <asp:Parameter Name="Siralama" Type="Int32" DefaultValue="-1"></asp:Parameter>
    <asp:SessionParameter DefaultValue="-1" Name="UyeId" SessionField="UyeId" Type="Int32" />
    <asp:CookieParameter CookieName="dil" DefaultValue="TR" Name="Dil" Type="String"></asp:CookieParameter>
</SelectParameters>
        </asp:SqlDataSource>                 
        </div>
      </div>
      <!--SAYFALAMA-->
      <div class="urun-sayfalama-kapsam">
          <ul class="pagination">
            <li>
          <asp:DataPager ID="lvDataPager1" runat="server" PagedControlID="listCanta" PageSize="12">
                <Fields>
                    <asp:NumericPagerField ButtonType="Link" />
                </Fields>            
            </asp:DataPager> 
            </li> 
        </ul>
        <%--<ul class="pagination">
          <li><a href="#">&laquo;</a></li>
          <li class="active"><a href="#">1</a></li>
          <li><a href="#">2</a></li>
          <li><a href="#">3</a></li>
          <li><a href="#">4</a></li>
          <li><a href="#">5</a></li>
          <li><a href="#">&raquo;</a></li>
        </ul>--%>
      </div>
      <!--//SAYFALAMA--> 
    </div>
    <!--//GÖVDE ORTA KAPSAM-->
    <div id="govde-sag"></div>
  </div>
 
</asp:Content>  
